import 'package:app/util/http.dart';
import 'package:flutter/material.dart';

class ReceptionApi {
  BuildContext? context;

  static ReceptionApi of(BuildContext? context) {
    ReceptionApi receptionApi = ReceptionApi();
    receptionApi.context = context;
    return receptionApi;
  }

  /// 查询物料流向信息
  Future<dynamic> materialFlow(code) async {
    return await ApiService.of(context).get("lgs/reception/materialFlow/" + code);
  }

  /// 通过任务号进行直投处理
  Future<dynamic> directPut(data) async {
    return await ApiService.of(context).put("lgs/reception/save", data);
  }

  /// 报工周转处理
  Future<dynamic> turnover(data) async {
    return await ApiService.of(context).put("lgs/reception/turnover", data);
  }

  /// 直流
  Future<dynamic> direct(code) async {
    return await ApiService.of(context).get("lgs/reception/direct/" + code);
  }

  /// 入库
  Future<dynamic> inbound(code) async {
    return await ApiService.of(context).get("lgs/reception/inbound/" + code);
  }

  /// 打印查询任务类型
  Future<dynamic> print(code) async {
    return await ApiService.of(context).get("lgs/reception/print/" + code);
  }

}
